ACTOR Unmaker : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 1800
	Weapon.AmmoUse1 2
	Weapon.AmmoGive 100
	Weapon.AmmoType1 "SoulAmmo"
	Weapon.PreferredSkin "Flamethrower Marine"
    Inventory.PickupSound "BFGREADY"
    +WEAPON.NOAUTOAIM
	Inventory.PickupMessage "You got the sinister Unmaker, the power of hell itself. (Slot 7)"
	Inventory.ForbiddenTo Sorcerer, Paladin, Corvus
	States
	{
	Steady:
	TNT1 A 1
	Goto Ready
	Ready:
	Ready3:
	ReadyLoop:
	Reload:
		UNHG ABCDD 2 A_WeaponReady
		UNHG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        UNHG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		UNHG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		
		UNHG DCBA 2 A_WeaponReady
		UNHG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        UNHG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		UNHG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		
		
		UNHG AAAA 2 A_WeaponReady
		UNHG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        UNHG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		UNHG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		Goto Ready3
		
	Deselect:
		UNHG A   1 A_Lower
		UNHG A 0 A_StopSOund(1)
		UNHG A 0 A_StopSOund(6)
		UNHG A 0 A_TakeInventory("TossGrenade", 1)
		Loop
	Select:
		TNT1 AAAAAAAAAA 0 A_RAise
		TNT1 A 1 A_Raise
		UNHG A 0 A_PlaySound("BFGREADY")
        TNT1 AAA 0
		Goto SelectAnimation
		
	SelectAnimation:
		UNHS ABCD 1
		UNHG A 0 A_GunFlash
		GOto Ready
		
    Spawn:
        UNHW A -1
        Stop
	
	Altfire: 
	Fire:
		UNHG A 0
		UNHG A 0 A_PlaySOund("UNMSTA", 1)
		UNHF ABCD 1
		UNHG A 0 A_ZoomFactor(0.95)
	Hold:	
	    UNHF E 1 BRIGHT
		UNHG A 0 A_PlaySOund("UNMLOP", 6, 1, 1)
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHF F 1 BRIGHT
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser2", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHF G 1 BRIGHT
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHF H 1 BRIGHT
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser2", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHG A 0 A_Refire
		
		UNHG A 0 A_ZoomFactor(1.0)
		UNHG A 0 A_StopSOund(1)
		UNHG A 0 A_StopSOund(6)
		UNHG A 0 A_PlaySOund("UNMSTO", 1)
		UNHF DCBA 1
		Goto Ready3
		
	}
}


Actor UnmakerLaser: FastProjectile
{
	+RANDOMIZE
	+FORCEXYBILLBOARD
	+DONTSPLASH
	-BLOODSPLATTER
	damage (random(50, 50))
	radius 1
	height 1
	speed 500
	renderstyle ADD
	alpha 0.9
	scale .15
	decal "scorch"
	damagetype "desintegrate"
	missiletype "UnmakerLaserTrail"
	states
		{
		Spawn:
			LEYS R 1 BRIGHT
			Loop
	Death:
	XDeath:
	UNHG A 0
	UNHG A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	EXPL A 0 A_CustomMissile ("FlamethrowerFireParticles", 6, 0, random (0, 360), 2, random (0, 90))
	//FRFX ZZZ 0 BRIGHT A_CustomMissile ("BigBlackSmoke", 2, 0, random (0, 360), 2, random (0, 30))
	//TNT1 A 2 A_SpawnItem("BurningGroundLowDamage")
	UNHG A 0 A_CustomMissile("FlamethrowerBurningStuff", random (-32, 0), random (-32, 32), random (-32, 32), 2, random (-32, 32))
	UNHG A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	UNHG A 0 A_SpawnItemEx ("DetectCeilCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	UNHG A 0 A_explode(20, 100)
	TNT1 A 20 A_CustomMissile ("BigBlackSmoke", 0, 0, random (0, 360), 2, random (40, 160))
	Stop
		}
	}
	
	
Actor UnmakerLaser2: UnmakerLaser
{
	
	decal "none"
	states
		{
		Spawn:
			LEYS R 1 BRIGHT
			Loop
	Death:
	XDeath:
	UNHG A 0
	UNHG A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	EXPL A 0 A_CustomMissile ("FlamethrowerFireParticles", 6, 0, random (0, 360), 2, random (0, 90))
	//UNHG A 0 A_CustomMissile("FlamethrowerBurningStuff", random (-32, 0), random (-32, 32), random (-32, 32), 2, random (-32, 32))
	//UNHG A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	//UNHG A 0 A_SpawnItemEx ("DetectCeilCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	UNHG A 0 A_explode(20, 100)
	//TNT1 A 20 A_CustomMissile ("BigBlackSmoke", 0, 0, random (0, 360), 2, random (40, 160))
	Stop
		}
	}	
	
	
Actor UnmakerLaserTrail
{
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	+NOBLOCKMAP
	+NOGRAVITY
	+SHADOW
	+NOTELEPORT
	+CANNOTPUSH
	+NODAMAGETHRUST
	renderstyle ADD
	alpha 0.9
	scale .15
	states
		{
		Spawn:
			LEYS R 0
			LEYS R 1 BRIGHT
			Stop
		}
	}	
